package com.jzqf.harmonydemo.utils;

import ohos.agp.utils.LayoutAlignment;
import ohos.agp.window.dialog.ToastDialog;
import ohos.app.Context;

/**
 * toast工具类
 *
 * @author LiuWeiHao
 * 2021/5/6 17:53
 */
public class ToastUtil {

    public static void show(Context context, String message) {
        context.getUITaskDispatcher().asyncDispatch(() -> new ToastDialog(context)
                .setText(message)
                .setAlignment(LayoutAlignment.BOTTOM)
                .setOffset(0, 200)
                .show());
    }
}
